<?php
/**
 * Created by liuguangsheng.
 * Purpose: 这个类用于:后台订单展示
 * Date: 2017/10/16
 * Time: 10:45
 */
namespace App\Http\Controllers\Admin\Orders\Api;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;

class AdminOrdersApi
{
	public function showOrders()
	{
		$orders = DB::table('orders')->get();
		return $orders;
	}

	public function showDetails($oid)
	{
		$res = DB::table('orders_details')->where('oid','=', $oid)->get()->toArray();
		return $res;
	}

	public function editOrders($oid)
	{
		$res = DB::table('orders')->where('id',$oid)->get();
		return $res;
	}

	public function doedit($id, $state)
	{
		$res = DB::table('orders')->where('id',$id)->update(['state'=>$state]);
		return $res;
	}
}